#ifndef MINIOBJECT_H
#define MINIOBJECT_H

#include <QtGui>
#include <QtSql>

class MiniObject
{
public:
    MiniObject(int id=-1);
    bool deleteMini();

    void setName(QString name);
    void setVorname(QString vorname);
    void setAnschrift(QString anschrift);
    void setPLZ(QString plz);
    void setOrt(QString ort);
    void setTelefon(QString telefon);
    void setTelefax(QString telefax);
    void setEmail(QString email);


    bool operator <(MiniObject *a);

    int getId() const;
    QString getName() const;
    QString getVorname() const;
    QString getFullName() const;
    QString getAnschrift() const;
    QString getPLZ() const;
    QString getOrt() const;
    QString getTelefon() const;
    QString getTelefax() const;
    QString getEmail() const;

    QListWidgetItem *getListWidgetItem();

    void startTransaction();
    void commitTransaction();

private:
    QSqlDatabase db;
    int id;
    QString name;
    QString vorname;
    QString anschrift;
    QString plz;
    QString ort;
    QString telefon;
    QString telefax;
    QString email;

    QListWidgetItem *listWidgetItem;

};

#endif // MINIOBJECT_H
